.container {
  --description-background-color: white;
  --code-background-color: #191A18;
  --code-foreground-color: white;
}

main *[id]:before {
  display: block;
  content: " ";
  margin-top: -5rem;
  height: 5rem;
  visibility: hidden;
}

main h2:first-child {
  margin-top: 0;
}

.container pre {
  background-color: var(--code-background-color);
  color: var(--code-foreground-color);
  padding: calc(1.45em / 2) 1.45em;
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  overflow-x: auto;
}

@media (min-width: 55em) { /* --wide-enough-for-two-columns */
  .container pre,
  .table {

    /* SHIM: Setting the width set to 100% seems to be causing scrollbars,
             when using grid layout. */
    width: var(--main-column-width);

    --nav-column-width: calc(1.45rem * 9);
    --grid-gap: calc(1.45rem * 3);
    --ol-margin-left: calc(1.45rem * 1);
    --main-column-width: calc(100vw - var(--nav-column-width) - var(--grid-gap) - var(--ol-margin-left));
  }
}

.nav {
  position: sticky;
  top: 5em;
  background: hsla(0, 0%, 100%, 0.95);

  /* Give the navigation a maximum height, so the “stickyness” will have an effect. */
  max-height: calc(100vh - 5em);
  overflow-y: auto;

  /* TBD: Would it better to limit the navigation height so that all of the items
          are visible when scrolled to the top of the page?
  max-height: calc(100vh - var(--header-height-in-ems)); */

  /* TBD: Is it useful to use em units here? (so that it will scale with the font size)
          Are there other places where we’re using pixel values that make this moot?
  --header-height-in-ems: calc(var(--header-height) / var(--font-size) * 1em); */

  /* TBD: Should these value come from a custom property instead?
  --header-height: 102.5;
  --font-size: 20; */
}

.nav h1 {
  display: inline;
}

.nav button {
  display: block;
  margin-bottom: 0.75em;
}

.nav a:not(:hover):not(:active):not(:focus) {
  color: inherit;
}
.nav a {
  text-shadow: none;
  background-image: none;
  text-decoration: none;
  display: block;
}

.nav ol,
.nav li {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}
.nav li li {
  padding-left: 1.45rem;
  font-size: 0.875em;
}

.subhidden {
  display: none !important;
}

.activelink {
  position: sticky;
  top: 0;
  display: block;
  background-color: white;
  border-bottom: 1px solid hsla(0, 0%, 0%, 0.12); /* Copied from the table style in the main content area */
}

.activemenuitem {
  font-weight: bold;
}

/* Hide the navigation on small screens, until the toggle button is pressed */
@media (max-width: 55em) { /* --wide-enough-for-two-columns */
  .hidden {
    display: none !important;
  }
}

